package speed2010.util;

import speed2010.middleware.comunicacao.Address;

public class ParAddressESsm extends AddressESsm {
	private Address addressNode2 = null;

	public ParAddressESsm(Address addressNode1, Address addressNode2, double ssm) {
		super(addressNode1, ssm);
		this.addressNode2 = addressNode2;
	}

	@Override
	public boolean equals(Object obj) {
		if (this.getAddressNode().equals(((ParAddressESsm) obj).getAddressNode())
				&& this.addressNode2.equals(((ParAddressESsm) obj).addressNode2)
				&& this.getSsm() == ((ParAddressESsm) obj).getSsm()) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public Address getAddressNode() {
		return super.getAddressNode();
	}
	
	public Address getAddressNode2() {
		return addressNode2;
	}

	public void setAddressNode2(Address addressNode2) {
		this.addressNode2 = addressNode2;
	}

	@Override
	public String toString() {
		return this.getAddressNode().toStringReduzido() + " - "
				+ this.getAddressNode2().toStringReduzido() + " - " + this.getSsm();
	}
}
